<?php
/**
 * Module Facebook
 *
 * @author develx
 */
class Facebook extends Module {
    protected $name = 'Facebook';
    protected $administrable = false;
    protected $version = '2010-08-18';
    protected $details = array('dependencies' => array(),
            'observes' => array('Facebook'));

    public function __construct(DBAPI $dbapi, RecordList $recordList) {
        parent::__construct($dbapi, $recordList);
    }

    public function install() {
        return true;
    }

    public function uninstall() {
        return true;
    }

    public function displayPublicLike($url = null, $layout = 'button_count',
            $showFaces = 'false', $width = 450, $height = 21,
            $colorScheme = 'light', $action = 'like') {
        if ($url == null) {
            $url = 'http://www.' . Config::DOMAIN_NAME . Config::WEB_DIR .
                    '/' . implode('/', Modules::getModule('View')->getUrl()) .
                    '/';
        }
        $params = array('url' => urlencode($url), 'layout' => $layout,
                'showFaces' => $showFaces, 'width' => $width, 'height' =>
                $height, 'colorScheme' => $colorScheme, 'action' => $action);
        $this->template('like', $params);
    }
}
?>
